package com.company.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.base.common.service.CrudService;
import com.base.common.utils.SQLUtil;
import com.company.dao.CompanyIntangibleMapper;
import com.company.model.CompanyDevice;
import com.company.model.CompanyIntangible;
import com.company.service.IntangibleService;
@Service
public class IntangibleServiceImpl extends CrudService<CompanyIntangibleMapper, CompanyIntangible> implements
		IntangibleService {

	public List<CompanyIntangible> findIntangibleByCompanyId(String companyId) {

		Map<String, String> params = new HashMap<String, String>();
		params.put("companyId", companyId);
		String sql = "SELECT * from company_intangible t where t.company_Id = #{companyId} ";
		List<CompanyIntangible> list = this.getList(sql, CompanyIntangible.class, params);
		return list;
	}

	public boolean deleteIntangibleByIds(String ids) throws Exception {
		String sql = "delete from company_intangible where id in ("
				+ SQLUtil.createInStr(ids) + ") ";
		int res = this.delete(sql);
		return true;
	}

	public boolean saveIntangible(CompanyIntangible companyIntangible)
			throws Exception {
		int res = this.saveOrUpdate(companyIntangible);
		return true;
	}
	
	public CompanyIntangible findIntangibleById(String id) throws Exception {
		return this.get(id);
	}

}
